package aj.service.impl;

import aj.bo.AjJs;
import aj.bo.AjJsManager;
import aj.dao.IAjJsManagerDao;
import aj.service.AjJsManagerService;
import aj.service.AjJsService;
import aj.vo.AjJsManagerVo;
import framework.common.Common;
import framework.util.queryFilter.service.impl.IBaseServiceImpl;
import javax.annotation.Resource;

import framework.util.queryFilter.service.impl.QueryFilter;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("AjJsManagerService")
public class AjJsManagerServiceImpl extends IBaseServiceImpl<AjJsManager, Integer> implements AjJsManagerService {

    @Resource
    private IAjJsManagerDao dao;

    @Resource
    private AjJsService ajJsService;


    @Override
    public void removeBoAndDetail(Integer lid) {
        AjJsManager ajJsManager = this.get(lid);
        ajJsManager.setIsDelete(Common.IS_YEW);
        this.update(ajJsManager);

        ajJsService.deleteByJmLid(lid);
    }

    @Override
    public List<AjJsManagerVo> listWithLastestAjJs(QueryFilter filter) {
        filter.getWhereList().forEach(item ->{
            item.getGeneratorSql();
        });
        return dao.listWithLastestAjJs(filter, filter.getParamMap());
    }
}

